<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<TITLE>
BidiUtils (Soy Complete)
</TITLE>


<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="BidiUtils (Soy Complete)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiGlobalDir.html" title="class in com.google.template.soy.internal.i18n"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.Dir.html" title="enum in com.google.template.soy.internal.i18n"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../../index.html?com/google/template/soy/internal/i18n/BidiUtils.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="BidiUtils.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.google.template.soy.internal.i18n</FONT>
<BR>
Class BidiUtils</H2>
<PRE>
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
  <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by "><B>com.google.template.soy.internal.i18n.BidiUtils</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>BidiUtils</B><DT>extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
</PRE>

<P>
Utility functions for performing common Bidi tests on strings.
<P>

<P>
<HR>

<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->

<A NAME="nested_class_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Nested Class Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.Dir.html" title="enum in com.google.template.soy.internal.i18n">BidiUtils.Dir</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enum for directionality type.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.Format.html" title="class in com.google.template.soy.internal.i18n">BidiUtils.Format</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A container class for Unicode formatting characters and for directionality
 string constants.</TD>
</TR>
</TABLE>
&nbsp;<!-- =========== FIELD SUMMARY =========== -->

<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.html#LEFT">LEFT</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"left" string constant.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.html#RIGHT">RIGHT</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"right" string constant.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.Dir.html" title="enum in com.google.template.soy.internal.i18n">BidiUtils.Dir</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.html#estimateDirection(java.lang.String)">estimateDirection</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;str)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Estimates the directionality of a string based on relative word counts.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.Dir.html" title="enum in com.google.template.soy.internal.i18n">BidiUtils.Dir</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.html#estimateDirection(java.lang.String, boolean)">estimateDirection</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;str,
                  boolean&nbsp;isHtml)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Like <A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.html#estimateDirection(java.lang.String)"><CODE>estimateDirection(String)</CODE></A>, but can treat <code>str</code> as HTML,
 ignoring HTML tags and escapes that would otherwise be mistaken for LTR text.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.Dir.html" title="enum in com.google.template.soy.internal.i18n">BidiUtils.Dir</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.html#getExitDir(java.lang.String)">getExitDir</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;str)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Like <A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.html#getExitDir(java.lang.String, boolean)"><CODE>getExitDir(String, boolean)</CODE></A>, but assumes <code>str</code> is not HTML or
 HTML-escaped.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.Dir.html" title="enum in com.google.template.soy.internal.i18n">BidiUtils.Dir</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.html#getExitDir(java.lang.String, boolean)">getExitDir</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;str,
           boolean&nbsp;isHtml)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the directionality of the last character with strong directionality in the string, or
 Dir.UNKNOWN if none was encountered.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.Dir.html" title="enum in com.google.template.soy.internal.i18n">BidiUtils.Dir</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.html#getUnicodeDir(java.lang.String)">getUnicodeDir</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;str)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Like <A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.html#getUnicodeDir(java.lang.String, boolean)"><CODE>getUnicodeDir(String, boolean)</CODE></A>, but assumes <code>str</code> is not HTML or
 HTML-escaped.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.Dir.html" title="enum in com.google.template.soy.internal.i18n">BidiUtils.Dir</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.html#getUnicodeDir(java.lang.String, boolean)">getUnicodeDir</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;str,
              boolean&nbsp;isHtml)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the directionality of a string as defined by the UBA's rules P2 and P3, i.e.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.html#hasAnyLtr(java.lang.String)">hasAnyLtr</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;str)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Like <A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.html#hasAnyLtr(java.lang.String, boolean)"><CODE>hasAnyLtr(String, boolean)</CODE></A>, but assumes
 <code>str</code> is not HTML / HTML-escaped.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.html#hasAnyLtr(java.lang.String, boolean)">hasAnyLtr</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;str,
          boolean&nbsp;isHtml)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Checks if the given string has any LTR characters in it.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.html#hasAnyRtl(java.lang.String)">hasAnyRtl</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;str)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Like <A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.html#hasAnyRtl(java.lang.String, boolean)"><CODE>hasAnyRtl(String, boolean)</CODE></A>, but assumes
 <code>str</code> is not HTML / HTML-escaped.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.html#hasAnyRtl(java.lang.String, boolean)">hasAnyRtl</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;str,
          boolean&nbsp;isHtml)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Checks if the given string has any RTL characters in it.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.html#isRtlLanguage(java.lang.String)">isRtlLanguage</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;languageString)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Check if a BCP 47 / III language code indicates an RTL language, i.e.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.Dir.html" title="enum in com.google.template.soy.internal.i18n">BidiUtils.Dir</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.html#languageDir(java.lang.String)">languageDir</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;languageString)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the directionality of the input language / locale.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->

<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Field Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="RIGHT"><!-- --></A><H3>
RIGHT</H3>
<PRE>
public static final <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>RIGHT</B></PRE>
<DL>
<DD>"right" string constant.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../../constant-values.html#com.google.template.soy.internal.i18n.BidiUtils.RIGHT">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="LEFT"><!-- --></A><H3>
LEFT</H3>
<PRE>
public static final <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>LEFT</B></PRE>
<DL>
<DD>"left" string constant.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../../constant-values.html#com.google.template.soy.internal.i18n.BidiUtils.LEFT">Constant Field Values</A></DL>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="languageDir(java.lang.String)"><!-- --></A><H3>
languageDir</H3>
<PRE>
public static <A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.Dir.html" title="enum in com.google.template.soy.internal.i18n">BidiUtils.Dir</A> <B>languageDir</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;languageString)</PRE>
<DL>
<DD>Returns the directionality of the input language / locale.
 See <A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.html#isRtlLanguage(java.lang.String)"><CODE>isRtlLanguage(java.lang.String)</CODE></A> for more info.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="isRtlLanguage(java.lang.String)"><!-- --></A><H3>
isRtlLanguage</H3>
<PRE>
public static boolean <B>isRtlLanguage</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;languageString)</PRE>
<DL>
<DD>Check if a BCP 47 / III language code indicates an RTL language, i.e. either:
 - a language code explicitly specifying one of the right-to-left scripts,
   e.g. "az-Arab", or<p>
 - a language code specifying one of the languages normally written in a
   right-to-left script, e.g. "fa" (Farsi), except ones explicitly specifying
   Latin or Cyrillic script (which are the usual LTR alternatives).<p>
 The list of right-to-left scripts appears in the 100-199 range in
 http://www.unicode.org/iso15924/iso15924-num.html, of which Arabic and
 Hebrew are by far the most widely used. We also recognize Thaana, N'Ko, and
 Tifinagh, which also have significant modern usage. The rest (Syriac,
 Samaritan, Mandaic, etc.) seem to have extremely limited or no modern usage
 and are not recognized.
 The languages usually written in a right-to-left script are taken as those
 with Suppress-Script: Hebr|Arab|Thaa|Nkoo|Tfng  in
 http://www.iana.org/assignments/language-subtag-registry,
 as well as Sindhi (sd) and Uyghur (ug).
 The presence of other subtags of the language code, e.g. regions like EG
 (Egypt), is ignored.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="hasAnyLtr(java.lang.String, boolean)"><!-- --></A><H3>
hasAnyLtr</H3>
<PRE>
public static boolean <B>hasAnyLtr</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;str,
                                boolean&nbsp;isHtml)</PRE>
<DL>
<DD>Checks if the given string has any LTR characters in it. Note that LRE/RLE/LRO/RLO/PDF
 characters are ignored.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>str</CODE> - the string to be tested<DD><CODE>isHtml</CODE> - whether str is HTML / HTML-escaped
<DT><B>Returns:</B><DD>whether the string contains any LTR characters</DL>
</DD>
</DL>
<HR>

<A NAME="hasAnyLtr(java.lang.String)"><!-- --></A><H3>
hasAnyLtr</H3>
<PRE>
public static boolean <B>hasAnyLtr</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;str)</PRE>
<DL>
<DD>Like <A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.html#hasAnyLtr(java.lang.String, boolean)"><CODE>hasAnyLtr(String, boolean)</CODE></A>, but assumes
 <code>str</code> is not HTML / HTML-escaped.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>str</CODE> - the string to be tested
<DT><B>Returns:</B><DD>whether the string contains any LTR characters</DL>
</DD>
</DL>
<HR>

<A NAME="hasAnyRtl(java.lang.String, boolean)"><!-- --></A><H3>
hasAnyRtl</H3>
<PRE>
public static boolean <B>hasAnyRtl</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;str,
                                boolean&nbsp;isHtml)</PRE>
<DL>
<DD>Checks if the given string has any RTL characters in it. Note that LRE/RLE/LRO/RLO/PDF
 characters are ignored.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>str</CODE> - the string to be tested<DD><CODE>isHtml</CODE> - whether str is HTML / HTML-escaped
<DT><B>Returns:</B><DD>whether the string contains any RTL characters</DL>
</DD>
</DL>
<HR>

<A NAME="hasAnyRtl(java.lang.String)"><!-- --></A><H3>
hasAnyRtl</H3>
<PRE>
public static boolean <B>hasAnyRtl</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;str)</PRE>
<DL>
<DD>Like <A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.html#hasAnyRtl(java.lang.String, boolean)"><CODE>hasAnyRtl(String, boolean)</CODE></A>, but assumes
 <code>str</code> is not HTML / HTML-escaped.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>str</CODE> - the string to be tested
<DT><B>Returns:</B><DD>whether the string contains any RTL characters</DL>
</DD>
</DL>
<HR>

<A NAME="getUnicodeDir(java.lang.String, boolean)"><!-- --></A><H3>
getUnicodeDir</H3>
<PRE>
public static <A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.Dir.html" title="enum in com.google.template.soy.internal.i18n">BidiUtils.Dir</A> <B>getUnicodeDir</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;str,
                                          boolean&nbsp;isHtml)</PRE>
<DL>
<DD>Returns the directionality of a string as defined by the UBA's rules P2 and P3, i.e. the
 directionality of its first strong (L, R, or AL) character (with LRE/RLE/LRO/RLO/PDF having no
 effect). However returns Dir.UNKNOWN if no strong characters were encountered (which P3 says
 should be treated as LTR).
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>str</CODE> - the string to check<DD><CODE>isHtml</CODE> - whether str is HTML / HTML-escaped</DL>
</DD>
</DL>
<HR>

<A NAME="getUnicodeDir(java.lang.String)"><!-- --></A><H3>
getUnicodeDir</H3>
<PRE>
public static <A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.Dir.html" title="enum in com.google.template.soy.internal.i18n">BidiUtils.Dir</A> <B>getUnicodeDir</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;str)</PRE>
<DL>
<DD>Like <A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.html#getUnicodeDir(java.lang.String, boolean)"><CODE>getUnicodeDir(String, boolean)</CODE></A>, but assumes <code>str</code> is not HTML or
 HTML-escaped.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="getExitDir(java.lang.String, boolean)"><!-- --></A><H3>
getExitDir</H3>
<PRE>
public static <A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.Dir.html" title="enum in com.google.template.soy.internal.i18n">BidiUtils.Dir</A> <B>getExitDir</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;str,
                                       boolean&nbsp;isHtml)</PRE>
<DL>
<DD>Returns the directionality of the last character with strong directionality in the string, or
 Dir.UNKNOWN if none was encountered. For efficiency, actually scans backwards from the end of
 the string. Treats a (non-BN) character between an LRE/RLE/LRO/RLO and its matching PDF as a
 strong character, LTR after LRE/LRO, and RTL after RLE/RLO. The results are undefined for a
 string containing unbalanced LRE/RLE/LRO/RLO/PDF characters. The intended use is to check
 whether a logically separate item that starts with a number or a character of the string's exit
 directionality and follows this string inline (not counting any neutral characters in between)
 would "stick" to it in an opposite-directionality context, thus being displayed in an incorrect
 position. An LRM or RLM character (the one of the context's directionality) between the two
 will prevent such sticking.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>str</CODE> - the string to check<DD><CODE>isHtml</CODE> - whether str is HTML / HTML-escaped</DL>
</DD>
</DL>
<HR>

<A NAME="getExitDir(java.lang.String)"><!-- --></A><H3>
getExitDir</H3>
<PRE>
public static <A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.Dir.html" title="enum in com.google.template.soy.internal.i18n">BidiUtils.Dir</A> <B>getExitDir</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;str)</PRE>
<DL>
<DD>Like <A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.html#getExitDir(java.lang.String, boolean)"><CODE>getExitDir(String, boolean)</CODE></A>, but assumes <code>str</code> is not HTML or
 HTML-escaped.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="estimateDirection(java.lang.String)"><!-- --></A><H3>
estimateDirection</H3>
<PRE>
public static <A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.Dir.html" title="enum in com.google.template.soy.internal.i18n">BidiUtils.Dir</A> <B>estimateDirection</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;str)</PRE>
<DL>
<DD>Estimates the directionality of a string based on relative word counts.
 If the number of RTL words is above a certain percentage of the total number of strongly
 directional words, returns RTL.
 Otherwise, if any words are strongly or weakly LTR, returns LTR.
 Otherwise, returns UNKNOWN, which is used to mean "neutral".
 Numbers are counted as weakly LTR.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>str</CODE> - the string to check
<DT><B>Returns:</B><DD>the string's directionality</DL>
</DD>
</DL>
<HR>

<A NAME="estimateDirection(java.lang.String, boolean)"><!-- --></A><H3>
estimateDirection</H3>
<PRE>
public static <A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.Dir.html" title="enum in com.google.template.soy.internal.i18n">BidiUtils.Dir</A> <B>estimateDirection</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;str,
                                              boolean&nbsp;isHtml)</PRE>
<DL>
<DD>Like <A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.html#estimateDirection(java.lang.String)"><CODE>estimateDirection(String)</CODE></A>, but can treat <code>str</code> as HTML,
 ignoring HTML tags and escapes that would otherwise be mistaken for LTR text.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>str</CODE> - the string to check<DD><CODE>isHtml</CODE> - whether str is HTML / HTML-escaped</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiGlobalDir.html" title="class in com.google.template.soy.internal.i18n"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../../com/google/template/soy/internal/i18n/BidiUtils.Dir.html" title="enum in com.google.template.soy.internal.i18n"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../../index.html?com/google/template/soy/internal/i18n/BidiUtils.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="BidiUtils.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>

        
          <div id="footer">
            <div id="footerlogo" style="float:left">
              <img src="http://www.google.com/images/art.gif"
                   alt="Google colored balls">
            </div>
            <div id="copyright" style="float:left">
              <p>
                &copy; 2009 Google -
                <a href="http://www.google.com/privacy.html">Privacy Policy</a> -
                <a href="http://www.google.com/terms_of_service.html">Terms and Conditions</a> -
                <a href="http://www.google.com/about.html">About Google</a>
              </p>
            </div>
          </div>
        
      
</BODY>
</HTML>
